<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="dwz" uri="http://www.lyjuan.cn/dwz/tags" %>
<div class="pageContent">
	<form method="post" action="<dwz:url url="manage/addManage"/>" class="pageForm"
          onsubmit="return validateCallback(this, customDialogAjaxDone(true, 'manage_manageList'));">
		<div class="pageFormContent" layoutH="58">
			<p>
				<label>账号：</label>
				<input type="text" name="name" class="required" tabindex="1" maxlength="20" />
			</p>
			<p>
				<label>密码：</label>
				<input type="text" maxlength="20" name="pwd" id="pwd" class="required" tabindex="2" placeholder="6 - 20 位"/>
            </p>
            <p>
                <label>&nbsp;</label>
				<input type="button" onclick="resetPwd();" style="width:206px;" value="刷新密码" tabindex="3"/>
			</p>
			
			<p>
				<label>说明：</label>
				<textarea name="info" style="width:200px;" rows="5" maxlength="50" tabindex="4"></textarea>
			</p>
			<p>
				<label>状态：</label>
				<input type="radio" name="status" value="1" id="status_normal" checked="checked"/>
                <span onclick="$(this).parents('form:first').find('#status_normal').click();">正常</span>&nbsp;&nbsp;
				<input type="radio" name="status" value="0" id="status_lock"/>
                <span onclick="$(this).parents('form:first').find('#status_lock').click();">锁定</span>
			</p>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
	
</div>

<script>
	/**
	 * 重置密码
	 */
	var resetPwd = function()
	{
		var text = 'abcdefghijkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ2345678923456789';// 去掉 l L 1 I 0 o O，并增大数字的比例
		var pwd = [];
		for (var i = 0; i < 6; i++)
		{
			var num = Math.random();
			num = num * 100;
			num = Math.floor(num);
			num = num % text.length;// text 长度
			pwd.push(text.charAt(num));
		}

		pwd = pwd.join('');

		document.getElementById('pwd').value = pwd;
	};
</script>